<?php
$this->breadcrumbs = array(
    'Post' => array('index'),
    'Report Abuse' => array('reportabuse'),
);
?>
<div class="box">
    <header>
        <h5><i class="icon icon-user"></i> - Manage Abuse Reporting</h5>
    </header>
    Select type( post or comment) that you want to view:
    <select id="select-type">
	<option value="post" <?php if (isset($_GET['type']) && $_GET['type'] == 'post') echo 'selected'; ?>>Post</option>
	<option value="comment" <?php if (isset($_GET['type']) && $_GET['type'] == 'comment') echo 'selected'; ?>>Comment</option>
    </select>
    <div class="alert alert-warning">If you press the trash icon below, the system will delete a comment or post on this row</div>
    <div class="box">
	<?php
	if (isset($_GET['type']) && $_GET['type'] == 'comment') {
	    $this->renderPartial('_reportabuse/comment', array('model' => $model, 'aStatementAbuse' => $aStatementAbuse));
	} else {
	    $this->renderPartial('_reportabuse/post', array('model' => $model, 'aStatementAbuse' => $aStatementAbuse));
	}
	?>
    </div>
</div>

<script>
    $(document).ready(function() {
	$('#select-type').change(function() {
	    var type = $(this).val();
	    window.location.assign("<?php echo BACKEND_SITE_URL ?>post/reportabuse?type=" + type);
	});
    });
</script>